package com.silver.weibo.server.Impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.silver.weibo.dao.BlogMapper;
import com.silver.weibo.entity.Blogs;
import com.silver.weibo.entity.dto.BlogListDTO;
import com.silver.weibo.entity.vo.BlogDetailVO;
import com.silver.weibo.server.BlogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class BlogServiceImpl extends ServiceImpl<BlogMapper, Blogs> implements BlogService {

    private final BlogMapper blogMapper;

    @Autowired
    public BlogServiceImpl(BlogMapper blogMapper) {
        this.blogMapper = blogMapper;
    }

    @Override
    public BlogDetailVO selectOneById(Integer id) {
        return blogMapper.selectOneById(id);
    }

    @Override
    public void selectAllByActive(IPage<BlogDetailVO> page, BlogListDTO blogListDTO) {
        blogMapper.selectAllByActive(page, blogListDTO);
    }
}
